
#import "ZGLHotBaseCell.h"

@interface ZGLHotBaseCell()

@end
@implementation ZGLHotBaseCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        
        _background = [[UIView alloc]init];
        _background.layer.shadowColor = [UIColor blackColor].CGColor;
        _background.layer.shadowOffset = CGSizeMake(2,2);
        _background.layer.shadowOpacity = 0.8;
        _background.layer.shadowRadius = 4;
        [self.contentView addSubview:_background];
        
        _img = [[UIImageView alloc]init];
        _img.backgroundColor = [UIColor lightGrayColor];
        [_background addSubview:_img];
        
        _title = [[UILabel alloc]init];
        _title.numberOfLines = 0;
        [_title sizeToFit];
        [_background addSubview:_title];
        
        _source = [[UILabel alloc]init];
        _source.textColor = [UIColor lightGrayColor];
        _source.font = [UIFont systemFontOfSize:10];
        [_background addSubview:_source];
        
        _line = [[UILabel alloc]init];
        _line.backgroundColor = [UIColor lightGrayColor];
        [_background addSubview:_line];
    }
    return self;
}

- (void)layoutSubviews{
    [super layoutSubviews];
    self.backgroundColor = backColor;
    _background.backgroundColor = foreColor;
    _title.textColor = artiColor;
    _background.frame = CGRectMake(12, 12, (int)350*ScaleX, (int)295*ScaleX);
    _img.frame = CGRectMake(0, 0, Width-25, (int)195*ScaleX);
    _title.frame = CGRectMake(15, (int)195*ScaleX+10, Width-55, 45);
    _source.frame = CGRectMake(15, (int)195*ScaleX+65, 100, 20);
    _line.frame = CGRectMake(15, (int)195*ScaleX+60, Width-55, 1);
}

- (void)setOtherMod:(ZGLHotModel *)mod{
    _height = (int)195*ScaleX+110;
    [_img sd_setImageWithURL:mod.img placeholderImage:[UIImage imageNamed:@"squirrel"]];
    _title.text = mod.title;
    _source.text = mod.source;
}

- (void)awakeFromNib {
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
}

@end
